<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text"
                value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Viewname')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-viewname" class="form-control" name="row[viewname]" type="text"
                value="{$row.viewname|htmlentities}" readonly>
        </div>
    </div>
 
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Fieldjson')}:</label>
        <div class="col-xs-12 col-sm-8">
            <table class="table fieldlist" data-template="basictpl" data-name="row[fieldjson]" id="first-table">
                <tr>
                    <td>{:__('视图字段')}</td>
                    <td>{:__('对应表')}</td>
                    <td>{:__('对应表字段')}</td>
                </tr>
                <tr>
                    <td colspan="5"><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></td>
                </tr>
            </table>

            <textarea name="row[fieldjson]" class="form-control hidden" cols="30"
                rows="5">{$row.fieldjson|htmlentities}</textarea>
            <!-- [{"column":"id","tablename":"fa_csmitsm_mdm_gongdan","tablecolumn":"id"}] -->
            <script id="basictpl" type="text/html">
                <tr class="form-inline">
                    <td>
                        <input type="text" name="<%=name%>[<%=index%>][column]" class="form-control"
                        size="12" value="<%=row.column%>" readonly>
                    </td>
                    <td><input type="text" name="<%=name%>[<%=index%>][tablename]" class="form-control selectpage sp-tablename"
                             id="tablename_<%=index%>" data-index="<%=index%>"
                            size="35" value="<%=row.tablename%>" placeholder=""
                            data-source="csmitsm/xcflowdbview/selectTables" data-field="tablename"
                            data-primary-key="tablename"/></td>
                            
                    <td><input type="text" name="<%=name%>[<%=index%>][tablecolumn]" class="form-control selectpage"
                            id="tablecolumn_<%=index%>" data-index="<%=index%>"
                            size="15" value="<%=row.tablecolumn%>" placeholder=""
                            data-source="csmitsm/xcflowdbview/selectTablefields?tablename=<%=row.tablename%>" data-field="name"
                            data-primary-key="name" /></td>
                </tr>
            </script>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Desc')}:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-desc" class="form-control " rows="5" name="row[desc]"
                cols="50">{$row.desc|htmlentities}</textarea>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">

            <div class="radio">
                {foreach name="statusList" item="vo"}
                <label for="row[status]-{$key|htmlentities}"><input id="row[status]-{$key|htmlentities}" name="row[status]" type="radio"
                        value="{$key|htmlentities}" {in name="key" value="$row.status" }checked{/in} /> {$vo|htmlentities}</label>
                {/foreach}
            </div>

        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>